﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace CPPProject.Migrations
{
    public partial class addmodel1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "A_ITEMTEMP",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_A_ITEMTEMP", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "a_temp_proway",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    Concode = table.Column<string>(maxLength: 1024, nullable: true),
                    Customer = table.Column<string>(maxLength: 1024, nullable: true),
                    Projectway = table.Column<string>(maxLength: 1024, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_a_temp_proway", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "geoCoordMap",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    Name = table.Column<string>(maxLength: 100, nullable: true),
                    Y = table.Column<decimal>(nullable: false),
                    X = table.Column<decimal>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_geoCoordMap", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "IMPORTTEST",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CirculationCode = table.Column<string>(maxLength: 255, nullable: true),
                    CCode = table.Column<string>(maxLength: 255, nullable: true),
                    OrderCode = table.Column<string>(maxLength: 255, nullable: true),
                    CirculationStatus = table.Column<string>(maxLength: 255, nullable: true),
                    FromSite = table.Column<string>(maxLength: 255, nullable: true),
                    ToSite = table.Column<string>(maxLength: 255, nullable: true),
                    BillDate = table.Column<string>(maxLength: 255, nullable: true),
                    ArrivalDate = table.Column<DateTime>(nullable: false),
                    Carrier = table.Column<string>(maxLength: 255, nullable: true),
                    CarrierContact = table.Column<string>(maxLength: 255, nullable: true),
                    CarrierPhone = table.Column<string>(maxLength: 255, nullable: true),
                    TransportCode = table.Column<string>(maxLength: 255, nullable: true),
                    CName = table.Column<string>(maxLength: 255, nullable: true),
                    CContact = table.Column<string>(maxLength: 255, nullable: true),
                    CPhone = table.Column<string>(maxLength: 255, nullable: true),
                    StatusDate = table.Column<string>(maxLength: 255, nullable: true),
                    Type = table.Column<string>(maxLength: 255, nullable: true),
                    F18 = table.Column<string>(maxLength: 255, nullable: true),
                    F19 = table.Column<string>(maxLength: 255, nullable: true),
                    F20 = table.Column<string>(maxLength: 255, nullable: true),
                    Code = table.Column<string>(maxLength: 255, nullable: true),
                    Count = table.Column<float>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IMPORTTEST", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "itemmappingtmp",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CItemName = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    CType = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 100, nullable: true),
                    ICategory = table.Column<int>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_itemmappingtmp", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "LocationTest",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    LocationType = table.Column<string>(maxLength: 100, nullable: true),
                    ContactType = table.Column<string>(maxLength: 100, nullable: true),
                    Code = table.Column<string>(maxLength: 100, nullable: true),
                    Name = table.Column<string>(maxLength: 100, nullable: true),
                    ChangeName = table.Column<string>(maxLength: 100, nullable: true),
                    Address = table.Column<string>(maxLength: 500, nullable: true),
                    WxPerson = table.Column<string>(maxLength: 100, nullable: true),
                    Customer = table.Column<string>(maxLength: 100, nullable: true),
                    LinkPerson = table.Column<string>(maxLength: 100, nullable: true),
                    Phone = table.Column<string>(maxLength: 100, nullable: true),
                    Remark = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_LocationTest", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_A_Rand",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    RandNum = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_A_Rand", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Action",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CTransCode = table.Column<string>(maxLength: 100, nullable: true),
                    NUserID = table.Column<string>(maxLength: 100, nullable: true),
                    IType = table.Column<int>(nullable: false),
                    DCreateDate = table.Column<DateTime>(nullable: false),
                    DReceiveDate = table.Column<DateTime>(nullable: false),
                    DFinishDate = table.Column<DateTime>(nullable: false),
                    COpenId = table.Column<string>(maxLength: 100, nullable: true),
                    CNote = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Action", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Alert",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NMaxDwellTime = table.Column<int>(nullable: false),
                    NLocationCapacityRate = table.Column<int>(nullable: false),
                    INegative = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Alert", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_AlertLogs",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CField = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 100, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    CDesc = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_AlertLogs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_AppApply",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    ATitle = table.Column<string>(maxLength: 2000, nullable: true),
                    ADescription = table.Column<string>(maxLength: 200, nullable: true),
                    APictureOne = table.Column<string>(maxLength: 200, nullable: true),
                    APictureTwo = table.Column<string>(maxLength: 200, nullable: true),
                    APictureThree = table.Column<string>(maxLength: 200, nullable: true),
                    APictureFour = table.Column<string>(maxLength: 200, nullable: true),
                    Remark = table.Column<string>(maxLength: 5000, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_AppApply", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_AppComCodeVsUser",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    ACustomerID = table.Column<int>(nullable: false),
                    AUserID = table.Column<int>(nullable: false),
                    CCusCode = table.Column<string>(maxLength: 100, nullable: true),
                    ALoginCode = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_AppComCodeVsUser", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_AppCustomer",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CCompanyName = table.Column<string>(maxLength: 100, nullable: true),
                    CComPicture = table.Column<string>(maxLength: 100, nullable: true),
                    CCreateTime = table.Column<DateTime>(nullable: false),
                    CCreator = table.Column<string>(maxLength: 100, nullable: true),
                    CUserID = table.Column<int>(nullable: false),
                    CType = table.Column<int>(nullable: false),
                    NCustomerCode = table.Column<string>(maxLength: 100, nullable: true),
                    AuditDate = table.Column<DateTime>(nullable: false),
                    AuditUser = table.Column<string>(maxLength: 100, nullable: true),
                    Remark = table.Column<string>(maxLength: 100, nullable: true),
                    IndustryID = table.Column<int>(nullable: false),
                    CAddress = table.Column<string>(maxLength: 100, nullable: true),
                    CCity = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_AppCustomer", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_AppIndustry",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    IndustryName = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_AppIndustry", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ApplyVsProduct",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    ApplyID = table.Column<int>(nullable: false),
                    ProductID = table.Column<int>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ApplyVsProduct", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_AppOrderT_Biz_AppOrder",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NOrderCode = table.Column<string>(maxLength: 100, nullable: true),
                    ALoginCode = table.Column<string>(maxLength: 100, nullable: true),
                    CTelephone = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NItemID = table.Column<string>(maxLength: 100, nullable: true),
                    CItemName = table.Column<string>(maxLength: 100, nullable: true),
                    NQty = table.Column<string>(maxLength: 100, nullable: true),
                    NCreateDate = table.Column<DateTime>(nullable: false),
                    NCreatePhone = table.Column<string>(maxLength: 100, nullable: true),
                    NCreateUser = table.Column<string>(maxLength: 100, nullable: true),
                    CType = table.Column<string>(maxLength: 100, nullable: true),
                    CUserID = table.Column<string>(maxLength: 100, nullable: true),
                    CBusType = table.Column<string>(maxLength: 100, nullable: true),
                    NToAdress = table.Column<string>(maxLength: 100, nullable: true),
                    Orderpictrue = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_AppOrderT_Biz_AppOrder", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_AppProduct",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    PTitle = table.Column<string>(maxLength: 100, nullable: true),
                    PPicture = table.Column<string>(maxLength: 100, nullable: true),
                    PRemark = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_AppProduct", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Assembly",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    CAssemblyCode = table.Column<string>(maxLength: 100, nullable: true),
                    NQty = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Assembly", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_BeginQty",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NLocationID = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    DDate = table.Column<string>(maxLength: 100, nullable: true),
                    NBQty = table.Column<string>(maxLength: 100, nullable: true),
                    NInQty = table.Column<string>(maxLength: 100, nullable: true),
                    NOutQty = table.Column<string>(maxLength: 100, nullable: true),
                    NQty = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_BeginQty", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_BTItemBind",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CMac = table.Column<string>(maxLength: 100, nullable: true),
                    CSeqNo = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_BTItemBind", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_BTRecords",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CMac = table.Column<string>(maxLength: 100, nullable: true),
                    CSeqNo = table.Column<string>(maxLength: 100, nullable: true),
                    NTemp = table.Column<string>(maxLength: 100, nullable: true),
                    NQuantity = table.Column<string>(maxLength: 100, nullable: true),
                    NLongitude = table.Column<string>(maxLength: 100, nullable: true),
                    CAddress = table.Column<string>(maxLength: 100, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    CType = table.Column<string>(maxLength: 100, nullable: true),
                    CToken = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_BTRecords", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Carrier",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCarrierCode = table.Column<string>(maxLength: 100, nullable: true),
                    NCarrierID = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 300, nullable: true),
                    CAddress = table.Column<string>(maxLength: 300, nullable: true),
                    CContact = table.Column<string>(maxLength: 300, nullable: true),
                    NContact = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary = table.Column<bool>(nullable: false),
                    CContact1 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone1 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary1 = table.Column<bool>(nullable: false),
                    CContact2 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone2 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary2 = table.Column<bool>(nullable: false),
                    CContact3 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone3 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary3 = table.Column<bool>(nullable: false),
                    CContact4 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone4 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary4 = table.Column<string>(maxLength: 300, nullable: true),
                    CCreditCode = table.Column<string>(maxLength: 300, nullable: true),
                    NRegistCapital = table.Column<string>(maxLength: 300, nullable: true),
                    CLegalPerson = table.Column<string>(maxLength: 300, nullable: true),
                    CTaxNumber = table.Column<string>(maxLength: 300, nullable: true),
                    COpeningBank = table.Column<string>(maxLength: 300, nullable: true),
                    COpeningAccount = table.Column<string>(maxLength: 300, nullable: true),
                    IUse = table.Column<bool>(nullable: false),
                    IType = table.Column<string>(maxLength: 300, nullable: true),
                    CCarriageContract = table.Column<string>(maxLength: 300, nullable: true),
                    CImageUrl = table.Column<string>(maxLength: 300, nullable: true),
                    NReciveID = table.Column<string>(maxLength: 300, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Carrier", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Carrier_vcode",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCarrierCode = table.Column<string>(maxLength: 100, nullable: true),
                    CVCode = table.Column<string>(maxLength: 100, nullable: true),
                    DInvalidDate = table.Column<DateTime>(nullable: false),
                    CPhone = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Carrier_vcode", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_CarrierDetails",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCarrierCode = table.Column<string>(maxLength: 100, nullable: true),
                    CDriverName = table.Column<string>(maxLength: 100, nullable: true),
                    CPhone = table.Column<string>(maxLength: 100, nullable: true),
                    CCarID = table.Column<string>(maxLength: 100, nullable: true),
                    CCarType = table.Column<string>(maxLength: 100, nullable: true),
                    COpenId = table.Column<string>(maxLength: 100, nullable: true),
                    CPlaceService = table.Column<string>(maxLength: 100, nullable: true),
                    CServiceType = table.Column<string>(maxLength: 100, nullable: true),
                    CServiceDesc = table.Column<string>(maxLength: 100, nullable: true),
                    CContractPrice = table.Column<string>(maxLength: 100, nullable: true),
                    CPriceUnit = table.Column<string>(maxLength: 100, nullable: true),
                    CServiceLine = table.Column<string>(maxLength: 100, nullable: true),
                    CServiceRemark = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_CarrierDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ChangePosition",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NLocation = table.Column<string>(maxLength: 100, nullable: true),
                    CFormPos = table.Column<string>(maxLength: 100, nullable: true),
                    CToPos = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NQty = table.Column<string>(maxLength: 100, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    CRemark = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ChangePosition", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Contract",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCode = table.Column<string>(maxLength: 100, nullable: true),
                    IBizType = table.Column<string>(maxLength: 100, nullable: true),
                    CCusCode = table.Column<string>(maxLength: 300, nullable: true),
                    CAddress = table.Column<string>(maxLength: 300, nullable: true),
                    CPayments = table.Column<string>(maxLength: 300, nullable: true),
                    NPaymentPeriod = table.Column<string>(maxLength: 300, nullable: true),
                    CRemark = table.Column<string>(maxLength: 300, nullable: true),
                    DStartDate = table.Column<DateTime>(nullable: false),
                    DEndDate = table.Column<DateTime>(nullable: false),
                    DReconciliationDate = table.Column<DateTime>(nullable: false),
                    IStatus = table.Column<string>(maxLength: 300, nullable: true),
                    CProjectName = table.Column<string>(maxLength: 300, nullable: true),
                    NDays = table.Column<string>(maxLength: 300, nullable: true),
                    WarningDays = table.Column<string>(maxLength: 300, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Contract", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ContractDetails",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCode = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 300, nullable: true),
                    NQty = table.Column<string>(maxLength: 100, nullable: true),
                    InPriceD = table.Column<string>(maxLength: 100, nullable: true),
                    NAmount = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ContractDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ContractPrice",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    DStartDate = table.Column<DateTime>(nullable: false),
                    DEndDate = table.Column<DateTime>(nullable: false),
                    CCode = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NPrice = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ContractPrice", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Customer",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCusCode = table.Column<string>(maxLength: 100, nullable: true),
                    NCustomerID = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 300, nullable: true),
                    CAddress = table.Column<string>(maxLength: 300, nullable: true),
                    CContact = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary = table.Column<bool>(nullable: false),
                    CContact1 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone1 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary1 = table.Column<bool>(nullable: false),
                    CContact2 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone2 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary2 = table.Column<bool>(nullable: false),
                    NContact3 = table.Column<string>(maxLength: 300, nullable: true),
                    NPhone3 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary3 = table.Column<bool>(nullable: false),
                    CContact4 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone4 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary4 = table.Column<bool>(nullable: false),
                    IUse = table.Column<bool>(nullable: false),
                    EMailAddress = table.Column<string>(maxLength: 300, nullable: true),
                    CGroup = table.Column<string>(maxLength: 300, nullable: true),
                    NSaleID = table.Column<string>(maxLength: 300, nullable: true),
                    CTaxNumber = table.Column<string>(maxLength: 300, nullable: true),
                    COpeningBank = table.Column<string>(maxLength: 300, nullable: true),
                    COpeningAccount = table.Column<string>(maxLength: 300, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Customer", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Item",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NConfigID = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NItemID = table.Column<string>(maxLength: 100, nullable: true),
                    CDescription = table.Column<string>(maxLength: 300, nullable: true),
                    NItemValue = table.Column<string>(maxLength: 300, nullable: true),
                    CImageUrl = table.Column<string>(maxLength: 300, nullable: true),
                    IUse = table.Column<bool>(nullable: false),
                    CItemName = table.Column<string>(maxLength: 300, nullable: true),
                    IsAssembly = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Item", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ItemBind",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CType = table.Column<string>(maxLength: 100, nullable: true),
                    CToken = table.Column<string>(maxLength: 300, nullable: true),
                    CItemSNo = table.Column<string>(maxLength: 300, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 300, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ItemBind", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ItemConfigHead",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NConfigID = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 100, nullable: true),
                    CType = table.Column<string>(maxLength: 100, nullable: true),
                    CDescription = table.Column<string>(maxLength: 100, nullable: true),
                    ICategory = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ItemConfigHead", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ItemConfigList",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NConfigID = table.Column<string>(maxLength: 100, nullable: true),
                    CPropertyName = table.Column<string>(maxLength: 100, nullable: true),
                    CPropertyDesc = table.Column<string>(maxLength: 100, nullable: true),
                    IRequre = table.Column<string>(maxLength: 100, nullable: true),
                    CPropertyType = table.Column<string>(maxLength: 100, nullable: true),
                    CPropertyField = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ItemConfigList", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ItemQR",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NSeq = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ItemQR", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ItemScrap",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CItemSNo = table.Column<string>(maxLength: 100, nullable: true),
                    NLocation = table.Column<string>(maxLength: 100, nullable: true),
                    IStatus = table.Column<bool>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ItemScrap", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ItemTracking",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CItemSNo = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NLocation = table.Column<string>(maxLength: 100, nullable: true),
                    CType = table.Column<bool>(nullable: false),
                    DDate = table.Column<DateTime>(nullable: false),
                    CTransCode = table.Column<string>(maxLength: 300, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 300, nullable: true),
                    CMappingID = table.Column<string>(maxLength: 300, nullable: true),
                    CPosCode = table.Column<string>(maxLength: 300, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ItemTracking", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Location",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NLocationID = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 300, nullable: true),
                    CAddress = table.Column<string>(maxLength: 300, nullable: true),
                    NLongitude = table.Column<string>(maxLength: 300, nullable: true),
                    NLatitude = table.Column<string>(maxLength: 300, nullable: true),
                    CCusCode = table.Column<string>(maxLength: 300, nullable: true),
                    NParentID = table.Column<string>(maxLength: 300, nullable: true),
                    NContact1 = table.Column<string>(maxLength: 300, nullable: true),
                    CContact1 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone1 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary1 = table.Column<bool>(nullable: false),
                    NContact2 = table.Column<string>(maxLength: 300, nullable: true),
                    CContact2 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone2 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary2 = table.Column<bool>(nullable: false),
                    CContact3 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone3 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary3 = table.Column<bool>(nullable: false),
                    CContact4 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone4 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary4 = table.Column<bool>(nullable: false),
                    CContact5 = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone5 = table.Column<string>(maxLength: 300, nullable: true),
                    NPrimary5 = table.Column<bool>(nullable: false),
                    IUse = table.Column<bool>(nullable: false),
                    NMaxCapacity = table.Column<string>(maxLength: 300, nullable: true),
                    IVirtual = table.Column<bool>(nullable: false),
                    IType = table.Column<string>(maxLength: 300, nullable: true),
                    NReciveID = table.Column<string>(maxLength: 300, nullable: true),
                    IInPosition = table.Column<bool>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Location", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_MonthSummary",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NYear = table.Column<string>(maxLength: 100, nullable: true),
                    NMonth = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NBeginQty = table.Column<string>(maxLength: 100, nullable: true),
                    NNewAddQty = table.Column<string>(maxLength: 100, nullable: true),
                    NToSaleQty = table.Column<string>(maxLength: 100, nullable: true),
                    NScrapQty = table.Column<string>(maxLength: 100, nullable: true),
                    NLoseQty = table.Column<string>(maxLength: 100, nullable: true),
                    NFinalQty = table.Column<string>(maxLength: 100, nullable: true),
                    NOnFunctionQty = table.Column<string>(maxLength: 100, nullable: true),
                    NUnUsedQty = table.Column<string>(maxLength: 100, nullable: true),
                    NItemUtilization = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_MonthSummary", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Order",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    COrderCode = table.Column<string>(maxLength: 100, nullable: true),
                    CCode = table.Column<string>(maxLength: 300, nullable: true),
                    CCusCode = table.Column<string>(maxLength: 300, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    DDeliveryDate = table.Column<DateTime>(nullable: false),
                    IStatus = table.Column<string>(maxLength: 300, nullable: true),
                    NFromLocationID = table.Column<string>(maxLength: 300, nullable: true),
                    NToLocationID = table.Column<string>(maxLength: 300, nullable: true),
                    IType = table.Column<string>(maxLength: 300, nullable: true),
                    CRemark = table.Column<string>(maxLength: 300, nullable: true),
                    NCreateUser = table.Column<string>(maxLength: 300, nullable: true),
                    CApplyReason = table.Column<string>(maxLength: 300, nullable: true),
                    COtherRequire = table.Column<string>(maxLength: 300, nullable: true),
                    CProjectName = table.Column<string>(maxLength: 300, nullable: true),
                    CAddress = table.Column<string>(maxLength: 300, nullable: true),
                    CContact = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone = table.Column<string>(maxLength: 300, nullable: true),
                    ITransMode = table.Column<string>(maxLength: 300, nullable: true),
                    CCardID = table.Column<string>(maxLength: 300, nullable: true),
                    CDPhone = table.Column<string>(maxLength: 300, nullable: true),
                    IBusType = table.Column<string>(maxLength: 300, nullable: true),
                    NDays = table.Column<string>(maxLength: 300, nullable: true),
                    NModifiUser = table.Column<string>(maxLength: 300, nullable: true),
                    NCheckUser = table.Column<string>(maxLength: 300, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Order", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_OrderDetails",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    COrderCode = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 300, nullable: true),
                    NQty = table.Column<string>(maxLength: 300, nullable: true),
                    NPrice = table.Column<string>(maxLength: 300, nullable: true),
                    NAmount = table.Column<string>(maxLength: 300, nullable: true),
                    NRate = table.Column<string>(maxLength: 300, nullable: true),
                    IStatus = table.Column<string>(maxLength: 300, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_OrderDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Position",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CPosName = table.Column<string>(maxLength: 100, nullable: true),
                    CPosCode = table.Column<string>(maxLength: 100, nullable: true),
                    IUse = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Position", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_PositionSum",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CPosCode = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    NLocationID = table.Column<string>(maxLength: 100, nullable: true),
                    NQty = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_PositionSum", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_ReceiveDetails",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CTransCode = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NQty = table.Column<string>(maxLength: 100, nullable: true),
                    NRQty = table.Column<string>(maxLength: 100, nullable: true),
                    CNote = table.Column<string>(maxLength: 100, nullable: true),
                    NDiffQty = table.Column<string>(maxLength: 100, nullable: true),
                    DDealDate = table.Column<DateTime>(maxLength: 100, nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_ReceiveDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_StockUp",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CTransCode = table.Column<string>(maxLength: 100, nullable: true),
                    CItemSNo = table.Column<string>(maxLength: 100, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 100, nullable: true),
                    NQty = table.Column<int>(maxLength: 100, nullable: false),
                    NLocationID = table.Column<int>(nullable: false),
                    ISend = table.Column<int>(maxLength: 100, nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_StockUp", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Tasks",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCode = table.Column<string>(maxLength: 100, nullable: true),
                    CInfo = table.Column<string>(maxLength: 100, nullable: true),
                    IStatus = table.Column<int>(maxLength: 100, nullable: false),
                    NUserID = table.Column<string>(maxLength: 100, nullable: true),
                    DCreateDate = table.Column<DateTime>(nullable: false),
                    DReceiveDate = table.Column<DateTime>(nullable: false),
                    DFinishDate = table.Column<DateTime>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Tasks", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_Transfer",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CTransCode = table.Column<string>(maxLength: 100, nullable: true),
                    COrderCode = table.Column<string>(maxLength: 300, nullable: true),
                    CCode = table.Column<string>(maxLength: 300, nullable: true),
                    IStatus = table.Column<string>(maxLength: 300, nullable: true),
                    NFromLocationID = table.Column<string>(maxLength: 300, nullable: true),
                    NToLocationID = table.Column<string>(maxLength: 300, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    DDeliveryDate = table.Column<DateTime>(nullable: false),
                    CCarrierCode = table.Column<string>(maxLength: 300, nullable: true),
                    NCarrierContact = table.Column<string>(maxLength: 300, nullable: true),
                    CCarrierContact = table.Column<string>(maxLength: 300, nullable: true),
                    CCarrierPhone = table.Column<string>(maxLength: 300, nullable: true),
                    CCard = table.Column<string>(maxLength: 300, nullable: true),
                    CCusCode = table.Column<string>(maxLength: 300, nullable: true),
                    CCusContact = table.Column<string>(maxLength: 300, nullable: true),
                    CCusPhone = table.Column<string>(maxLength: 300, nullable: true),
                    CCusAddress = table.Column<string>(maxLength: 300, nullable: true),
                    DStatusChangeDate = table.Column<DateTime>(nullable: false),
                    IType = table.Column<string>(maxLength: 300, nullable: true),
                    CRemark = table.Column<string>(maxLength: 300, nullable: true),
                    CDriverName = table.Column<string>(maxLength: 300, nullable: true),
                    CPhone = table.Column<string>(maxLength: 300, nullable: true),
                    NCarID = table.Column<string>(maxLength: 300, nullable: true),
                    NAmount = table.Column<string>(maxLength: 300, nullable: true),
                    NStatusChangeUser = table.Column<string>(maxLength: 300, nullable: true),
                    NCreateUser = table.Column<string>(maxLength: 300, nullable: true),
                    CAssicoatedData = table.Column<string>(maxLength: 300, nullable: true),
                    DSendDate = table.Column<DateTime>(nullable: false),
                    ITransMode = table.Column<string>(maxLength: 300, nullable: true),
                    CCardID = table.Column<string>(maxLength: 300, nullable: true),
                    CDPhone = table.Column<string>(maxLength: 300, nullable: true),
                    CProjectName = table.Column<string>(maxLength: 300, nullable: true),
                    IBusType = table.Column<string>(maxLength: 300, nullable: true),
                    ICreateByOrder = table.Column<string>(maxLength: 300, nullable: true),
                    CCarrierNote = table.Column<string>(maxLength: 300, nullable: true),
                    NDays = table.Column<string>(maxLength: 300, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_Transfer", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_TransferDetails",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NDays = table.Column<string>(maxLength: 100, nullable: true),
                    CTransCode = table.Column<string>(maxLength: 300, nullable: true),
                    CItemCode = table.Column<string>(maxLength: 300, nullable: true),
                    NQty = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_TransferDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Biz_UpdateTimeLine",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCode = table.Column<string>(maxLength: 100, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    CUpdateContent = table.Column<string>(maxLength: 100, nullable: true),
                    NUserID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Biz_UpdateTimeLine", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_ButtonsForModule",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CModuleCode = table.Column<string>(maxLength: 100, nullable: true),
                    CModuleName = table.Column<string>(maxLength: 100, nullable: true),
                    CButtonID = table.Column<string>(maxLength: 100, nullable: true),
                    CButtonName = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_ButtonsForModule", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_ChildrenModule",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CModuleCode = table.Column<string>(maxLength: 100, nullable: true),
                    CChildrenModuleCode = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_ChildrenModule", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_ColumnsForModule",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CModuleCode = table.Column<string>(maxLength: 100, nullable: true),
                    CModuleName = table.Column<string>(maxLength: 100, nullable: true),
                    CField = table.Column<string>(maxLength: 100, nullable: true),
                    CTitle = table.Column<string>(maxLength: 100, nullable: true),
                    CDataType = table.Column<string>(maxLength: 100, nullable: true),
                    NWidth = table.Column<string>(maxLength: 100, nullable: true),
                    CAlign = table.Column<string>(maxLength: 100, nullable: true),
                    IShow = table.Column<int>(nullable: false),
                    CSummaryType = table.Column<string>(maxLength: 100, nullable: true),
                    CColumnRender = table.Column<string>(maxLength: 100, nullable: true),
                    CHeaderRender = table.Column<string>(maxLength: 100, nullable: true),
                    NOrderID = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_ColumnsForModule", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_CustomerRegist",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NCustomerCode = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 100, nullable: true),
                    CAddress = table.Column<string>(maxLength: 100, nullable: true),
                    CContact = table.Column<string>(maxLength: 100, nullable: true),
                    CPhone = table.Column<string>(maxLength: 100, nullable: true),
                    CEmail = table.Column<string>(maxLength: 100, nullable: true),
                    IsAudit = table.Column<int>(nullable: false),
                    RegistDate = table.Column<DateTime>(nullable: false),
                    AuditDate = table.Column<DateTime>(nullable: false),
                    AuditUser = table.Column<string>(maxLength: 100, nullable: true),
                    CPictureAddress = table.Column<string>(maxLength: 100, nullable: true),
                    CPassward = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_CustomerRegist", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_Doc",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCode = table.Column<string>(maxLength: 100, nullable: true),
                    CFileName = table.Column<string>(maxLength: 100, nullable: true),
                    CFormat = table.Column<string>(maxLength: 100, nullable: true),
                    CClass = table.Column<string>(maxLength: 100, nullable: true),
                    NSize = table.Column<string>(maxLength: 100, nullable: true),
                    CFilePath = table.Column<string>(maxLength: 100, nullable: true),
                    DUploadDate = table.Column<DateTime>(nullable: false),
                    CPhysicalPath = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_Doc", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_Logs",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NModuleID = table.Column<string>(maxLength: 100, nullable: true),
                    DDateTime = table.Column<DateTime>(nullable: false),
                    CIPAddress = table.Column<string>(maxLength: 100, nullable: true),
                    NUserID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_Logs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_Module",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NModuleID = table.Column<string>(maxLength: 100, nullable: true),
                    NPModuleID = table.Column<string>(maxLength: 100, nullable: true),
                    CUrl = table.Column<string>(maxLength: 100, nullable: true),
                    CTitle = table.Column<string>(maxLength: 100, nullable: true),
                    CPath = table.Column<string>(maxLength: 100, nullable: true),
                    IUse = table.Column<int>(nullable: false),
                    CIcon = table.Column<string>(maxLength: 100, nullable: true),
                    NOrderID = table.Column<string>(maxLength: 100, nullable: true),
                    CModuleCode = table.Column<string>(maxLength: 300, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_Module", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_Params",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CCode = table.Column<string>(maxLength: 100, nullable: true),
                    CDescription = table.Column<string>(maxLength: 100, nullable: true),
                    CType = table.Column<string>(maxLength: 100, nullable: true),
                    CValue = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_Params", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_RegisterCompany",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CTelephone = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 100, nullable: true),
                    CCompanyName = table.Column<string>(maxLength: 100, nullable: true),
                    CEmail = table.Column<string>(maxLength: 100, nullable: true),
                    CPhone = table.Column<string>(maxLength: 100, nullable: true),
                    CAddress = table.Column<string>(maxLength: 100, nullable: true),
                    DDate = table.Column<DateTime>(nullable: false),
                    IActive = table.Column<int>(nullable: false),
                    CEntNo = table.Column<string>(maxLength: 100, nullable: true),
                    CLicenseUrl = table.Column<string>(maxLength: 100, nullable: true),
                    DActiveDate = table.Column<DateTime>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_RegisterCompany", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_RoleForButton",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CModuleCode = table.Column<string>(maxLength: 100, nullable: true),
                    CButtonID = table.Column<string>(maxLength: 100, nullable: true),
                    NRoleID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_RoleForButton", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_RoleForColumn",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CModuleCode = table.Column<string>(maxLength: 100, nullable: true),
                    CField = table.Column<string>(maxLength: 100, nullable: true),
                    NRoleID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_RoleForColumn", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_RoleForModule",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NRoleID = table.Column<string>(maxLength: 100, nullable: true),
                    CModuleCode = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_RoleForModule", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_Roles",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NRoleID = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    ISuperAdmin = table.Column<int>(nullable: false),
                    CName = table.Column<string>(maxLength: 100, nullable: true),
                    CDescription = table.Column<string>(maxLength: 100, nullable: true),
                    NUpRoleID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_Roles", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_Sequence",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    Seq_Name = table.Column<string>(maxLength: 100, nullable: true),
                    Seq_Desc = table.Column<string>(maxLength: 100, nullable: true),
                    Leading_Str = table.Column<string>(maxLength: 100, nullable: true),
                    Formatter = table.Column<string>(maxLength: 100, nullable: true),
                    Step = table.Column<int>(nullable: false),
                    Last_Value = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_Sequence", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_User",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NUserID = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    CPassword = table.Column<string>(maxLength: 100, nullable: true),
                    CEasyID = table.Column<string>(maxLength: 100, nullable: true),
                    CName = table.Column<string>(maxLength: 100, nullable: true),
                    CNickName = table.Column<string>(maxLength: 100, nullable: true),
                    ISex = table.Column<int>(nullable: false),
                    CTelephone = table.Column<string>(maxLength: 100, nullable: true),
                    CEmail = table.Column<string>(maxLength: 100, nullable: true),
                    IStatus = table.Column<int>(nullable: false),
                    DLoginTime = table.Column<DateTime>(nullable: false),
                    CIPAddress = table.Column<string>(maxLength: 100, nullable: true),
                    CToken = table.Column<string>(maxLength: 100, nullable: true),
                    OPENID = table.Column<string>(maxLength: 100, nullable: true),
                    CRelationCode = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_User", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Sys_UserInRole",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true),
                    NUserID = table.Column<string>(maxLength: 100, nullable: true),
                    NRoleID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Sys_UserInRole", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Table_1",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    公司ID = table.Column<string>(maxLength: 100, nullable: true),
                    站点名称 = table.Column<string>(maxLength: 100, nullable: true),
                    地址 = table.Column<string>(maxLength: 100, nullable: true),
                    联系人 = table.Column<string>(maxLength: 100, nullable: true),
                    电话 = table.Column<string>(maxLength: 100, nullable: true),
                    联系人1 = table.Column<string>(maxLength: 100, nullable: true),
                    联系电话1 = table.Column<string>(maxLength: 100, nullable: true),
                    虚拟站点 = table.Column<int>(nullable: false),
                    类型 = table.Column<int>(nullable: false),
                    关联客户 = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Table_1", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Test",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    Name = table.Column<string>(maxLength: 100, nullable: true),
                    Phone = table.Column<string>(maxLength: 100, nullable: true),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Test", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "合同",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    合同编号 = table.Column<string>(maxLength: 100, nullable: true),
                    业务类型 = table.Column<string>(maxLength: 100, nullable: true),
                    客户 = table.Column<string>(maxLength: 100, nullable: true),
                    结算方式 = table.Column<string>(maxLength: 100, nullable: true),
                    地址 = table.Column<string>(maxLength: 100, nullable: true),
                    付款账期 = table.Column<float>(nullable: false),
                    开始日期 = table.Column<DateTime>(nullable: false),
                    结束日期 = table.Column<DateTime>(nullable: false),
                    对账单日 = table.Column<float>(nullable: false),
                    资产编码 = table.Column<string>(maxLength: 100, nullable: true),
                    资产名称 = table.Column<string>(maxLength: 100, nullable: true),
                    数量 = table.Column<float>(nullable: false),
                    单价 = table.Column<float>(nullable: false),
                    NCompanyID = table.Column<string>(maxLength: 100, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_合同", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "A_ITEMTEMP");

            migrationBuilder.DropTable(
                name: "a_temp_proway");

            migrationBuilder.DropTable(
                name: "geoCoordMap");

            migrationBuilder.DropTable(
                name: "IMPORTTEST");

            migrationBuilder.DropTable(
                name: "itemmappingtmp");

            migrationBuilder.DropTable(
                name: "LocationTest");

            migrationBuilder.DropTable(
                name: "T_A_Rand");

            migrationBuilder.DropTable(
                name: "T_Biz_Action");

            migrationBuilder.DropTable(
                name: "T_Biz_Alert");

            migrationBuilder.DropTable(
                name: "T_Biz_AlertLogs");

            migrationBuilder.DropTable(
                name: "T_Biz_AppApply");

            migrationBuilder.DropTable(
                name: "T_Biz_AppComCodeVsUser");

            migrationBuilder.DropTable(
                name: "T_Biz_AppCustomer");

            migrationBuilder.DropTable(
                name: "T_Biz_AppIndustry");

            migrationBuilder.DropTable(
                name: "T_Biz_ApplyVsProduct");

            migrationBuilder.DropTable(
                name: "T_Biz_AppOrderT_Biz_AppOrder");

            migrationBuilder.DropTable(
                name: "T_Biz_AppProduct");

            migrationBuilder.DropTable(
                name: "T_Biz_Assembly");

            migrationBuilder.DropTable(
                name: "T_Biz_BeginQty");

            migrationBuilder.DropTable(
                name: "T_Biz_BTItemBind");

            migrationBuilder.DropTable(
                name: "T_Biz_BTRecords");

            migrationBuilder.DropTable(
                name: "T_Biz_Carrier");

            migrationBuilder.DropTable(
                name: "T_Biz_Carrier_vcode");

            migrationBuilder.DropTable(
                name: "T_Biz_CarrierDetails");

            migrationBuilder.DropTable(
                name: "T_Biz_ChangePosition");

            migrationBuilder.DropTable(
                name: "T_Biz_Contract");

            migrationBuilder.DropTable(
                name: "T_Biz_ContractDetails");

            migrationBuilder.DropTable(
                name: "T_Biz_ContractPrice");

            migrationBuilder.DropTable(
                name: "T_Biz_Customer");

            migrationBuilder.DropTable(
                name: "T_Biz_Item");

            migrationBuilder.DropTable(
                name: "T_Biz_ItemBind");

            migrationBuilder.DropTable(
                name: "T_Biz_ItemConfigHead");

            migrationBuilder.DropTable(
                name: "T_Biz_ItemConfigList");

            migrationBuilder.DropTable(
                name: "T_Biz_ItemQR");

            migrationBuilder.DropTable(
                name: "T_Biz_ItemScrap");

            migrationBuilder.DropTable(
                name: "T_Biz_ItemTracking");

            migrationBuilder.DropTable(
                name: "T_Biz_Location");

            migrationBuilder.DropTable(
                name: "T_Biz_MonthSummary");

            migrationBuilder.DropTable(
                name: "T_Biz_Order");

            migrationBuilder.DropTable(
                name: "T_Biz_OrderDetails");

            migrationBuilder.DropTable(
                name: "T_Biz_Position");

            migrationBuilder.DropTable(
                name: "T_Biz_PositionSum");

            migrationBuilder.DropTable(
                name: "T_Biz_ReceiveDetails");

            migrationBuilder.DropTable(
                name: "T_Biz_StockUp");

            migrationBuilder.DropTable(
                name: "T_Biz_Tasks");

            migrationBuilder.DropTable(
                name: "T_Biz_Transfer");

            migrationBuilder.DropTable(
                name: "T_Biz_TransferDetails");

            migrationBuilder.DropTable(
                name: "T_Biz_UpdateTimeLine");

            migrationBuilder.DropTable(
                name: "T_Sys_ButtonsForModule");

            migrationBuilder.DropTable(
                name: "T_Sys_ChildrenModule");

            migrationBuilder.DropTable(
                name: "T_Sys_ColumnsForModule");

            migrationBuilder.DropTable(
                name: "T_Sys_CustomerRegist");

            migrationBuilder.DropTable(
                name: "T_Sys_Doc");

            migrationBuilder.DropTable(
                name: "T_Sys_Logs");

            migrationBuilder.DropTable(
                name: "T_Sys_Module");

            migrationBuilder.DropTable(
                name: "T_Sys_Params");

            migrationBuilder.DropTable(
                name: "T_Sys_RegisterCompany");

            migrationBuilder.DropTable(
                name: "T_Sys_RoleForButton");

            migrationBuilder.DropTable(
                name: "T_Sys_RoleForColumn");

            migrationBuilder.DropTable(
                name: "T_Sys_RoleForModule");

            migrationBuilder.DropTable(
                name: "T_Sys_Roles");

            migrationBuilder.DropTable(
                name: "T_Sys_Sequence");

            migrationBuilder.DropTable(
                name: "T_Sys_User");

            migrationBuilder.DropTable(
                name: "T_Sys_UserInRole");

            migrationBuilder.DropTable(
                name: "Table_1");

            migrationBuilder.DropTable(
                name: "Test");

            migrationBuilder.DropTable(
                name: "合同");
        }
    }
}
